#!/bin/bash
#

for old in $(find /opt/test -name "*.txt");do
    date=$(date +"%Y_%m_%d")
    new="${old%.*}_${date}.${old##*.}"
    mv $old $new
done
echo "文件已重命名"
